/*var fnName=function(){
	  alert('Hello World');
	}();*/

function toLogin(){
	location.href=app.root+"/login/toComLogin.html?returnUrl="+location.href;
}
function toLogin1(){
	location.href=app.root+"/login/toComLogin1.html?returnUrl="+app.root+"/myTrans/trans/index.html";
}
function toRegist(){
	location.href=app.root+"/login/toComRegist.html?returnUrl="+location.href;
}

function exitLogin(){
	if(confirm("确定要退出吗？")){
		$.post(app.root+"/login/frontExit.html",{},function(data){
			//window.location.reload(true);
			location.href=app.root+"/default/index.html";
		});
	}
}
function changeAccountNum(){
	if(confirm("确定要切换账号吗？")){
		$.post(app.root+"/login/frontExit.html",{},function(data){
		    toLogin();
		});
	}
}

function sysproc(){
	//先查看是否登录。如果没登录。则去登录，登录成功并跳转到新版加工系统
	//如果已经登录，则要去校验，是否能进入加工系统，否则到提示页面去
	$.ajax({
		   type: "POST",
		   url: app.root+'/login/checkProcLogin.html',
		   dataType:'json',
		   success: function(data){
			   if(data.message =='notLogin'){
				   //alert("登陆信息过期，请重新登录");
				   location.href=app.root+"/login/toComLogin.html";
				   return;
			   }
			   if (data.returnUrl!=null){
				   if (data.returnUrl.indexOf("http://")>-1){
					   window.location.href = data.returnUrl;
				   }else{
					   window.location.href = app.root+data.returnUrl;
				   }
			   }
		   }
    });
}

function sysjpsj(){
	location.href=app.root+"/login/enterSystenByType.html?enterSysType=1&returnUrl="
				+app.root+"/login/enterSystenByType.html?enterSysType=1";
}

function syscys(){
	//跳转承运商系统
	 var url=app.root+"/login/checkTransLogin.html";
 	  $.ajax({
		     type : "post",
			 url : url,
 			 //dataType : "json",
			 success : function(data){

				 if(data.code=="-5"){
					 var b=confirm("您尚未完善公司信息,是否前去填写信息?");
					 if(b){
						 location.href=app.root+'/myLG/basic/basic.html';
					 }
				 }else if(data.code=="1"){
		     		 window.location.href=data.transPath;
				 }else if(data.code=="0"){//还在数据异常
					 toLogin1();
				 }else if(data.code=="-1"){//未入住
					 var b=confirm("您还不是承运商,是否申请入驻承运商?");
					 if(b){
						 window.location.href=app.root+"/myLG/toApplyTrans/toCorpInfoForTrans.html";
 					 }
				 }else if(data.code=="-2"){//审核中
					alert("您的承运商申请正在评审中,请耐心等待!");
				    return;
 				 }else if(data.code=="-3"){//审核未通过
 					var b=confirm("您的承运商评审未通过,是否重新申请评审?");
 				    if(b){
 				    	window.location.href=app.root+"/myLG/toApplyTrans/toCorpInfoForTrans.html";
 				    }
  				 }else if(data.code=="-4"){
 					 alert("系统操作异常,请联系乐刚客服!");
 					 return;
 				 }
			 }
	    })
}

function sysen(){
	$.ajax({
        type: "post",
        url: app.root+"/login/toEnglishMyLGCheck.html",//测试
        data : {},//请求的参数
        cache:false,
        dataType:"JSON",
        error:function(data) {
            window.location.href=app.root+"/login/toComLogin.html";//LgSteelLoginPath;
        },
        success: function(data){
        	if(data.status=='0'){//未登录

        		window.location.href = data.englishPath+"/front/enIndexAction_Index.action";

        	}else if(data.status=='1'){//已登录

        		 if (data.msg!=null) {
	                 alert(data.msg);
	                 return;
        		 }
    		   if (data.emSessionID!=null && data.englishPath!=null) {
                    window.location.href = data.englishPath+"/front/enIndexAction_toEnMyLGAjax.action?emssID="+data.emSessionID;//测试
                }

        	}else{

        		window.location.href=app.root+"/login/toComLogin.html";//LgSteelLoginPath;

        	}

        }
     });
}
// 搜全站
function searchMallInput(obj){

    var seaInput = $(obj).parent().find('.searchTitleInput').val();
    if(seaInput){
        $("#searchInputVal").val(seaInput);
        $("#wantToBuyForm").submit();
    }else{
        // 没有值，直接跳转
        window.location=app.root+"/mall/index.html";
    }

}
// 搜本店
function searchMallStoreInput(obj){
    $("#HeaderSearch").val("");
    var seaInput = $(obj).parent().find('.searchTitleInput').val();
    if(seaInput){
        $("#HeaderSearch").val(seaInput);
    }
    mallIndexUtil.sousuo_zy(0);
}

function searchMallByPm(pm){
    $("#wantToBuyForm [name='pm']").val(pm);
    $("#wantToBuyForm").submit();
}

function toDingGou(){
    window.location = app.root+"/customize/index.html";
}


